package com.hyopt.modules.app.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyopt.common.utils.QueryExt;
import com.hyopt.modules.app.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * TODO 会员dao
 *
 * @author crazypenguin
 * @version 1.0.0
 * @createdate 2019/1/3
 */
@Mapper
public interface UserDao extends BaseMapper<UserEntity> {
    List selectPageByConditions(QueryExt query, Map map);

    /**
     * 积分变动
     */
    Integer subCoinByMobile(@Param("mobile") String mobile, @Param("coin") Long coin);


    /**
     * 将token设为空
     */
    void tokenIsNull(@Param("id") Integer id);

    @Select("SELECT GroupNumber FROM Sys_User WHERE ID = #{uid}")
    Integer selectGrouopnumber(@Param("uid") Integer uid);

  @Select("SELECT DefenceNo FROM User_Defence WHERE UserId = #{uid}")
  List<String> selectDefence(@Param("uid") Integer uid);
}
